package com.wk1un2.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wk1un2.dao.MessagesDao;
import com.wk1un2.entity.Messages;
import com.wk1un2.service.MessagesService;

@Service
public class MessagesServiceImpl implements MessagesService {
	@Autowired
	private MessagesDao messagesdao;

	@Override
	public List<Messages> getAll(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return messagesdao.getAll(map);
	}

	@Override
	public Integer add(Messages messages) {
		// TODO Auto-generated method stub
		return messagesdao.insert(messages);
	}

	@Override
	public Integer update(Messages messages) {
		// TODO Auto-generated method stub
		return messagesdao.updateById(messages);
	}

	@Override
	public Integer delete(Integer mesid) {
		// TODO Auto-generated method stub
		return messagesdao.deleteById(mesid);
	}
	/**
	 * 未读消息
	 * 
	 * @param map
	 * @return
	 */
	@Override
	public List<Messages> getUnreadMessages(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return messagesdao.getUnreadMessages(map);
	}
	/**
	 * 已读消息
	 * 
	 * @param map
	 * @return
	 */
	@Override
	public List<Messages> getReadMessages(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return messagesdao.getReadMessages(map);
	}

}
